{* MODIFICATION DES DONNEES POUR UNE ECOLE *}

{if ($smarty.get.action =="modifier" and $smarty.get.valid==true and $erreurs!="")}
<form action="index.php5" method='get'>
    <input type='hidden' name='page' value='florient'>
    <input type='hidden' name='action' value='modifier_ecole'>
    <input type='hidden' name='valid' value=true>
    <input type='hidden' name='id' value="{$smarty.get.id}">
    <table align=center>
        <tr>
            <td class="titreForm">Nom de l'&eacute;cole</td>
            <td><input type="text" name="nom" value="{$smarty.get.nom}"></td>
        </tr>
        <tr>
            <td class="titreForm">Ecole priv&eacute;e/Publique</td>
            <td>
                Priv&eacute;e:&nbsp;<input type="radio" name="privPub" value="priv" {if $smarty.get.privPub == "priv"}checked="checked" {/if}>
                Publique:&nbsp;<input type="radio" name="privPub" value="pub" {if $smarty.get.privPub == "pub"}checked="checked"{/if}>
            </td>
        </tr>
        <tr>
            <td class="titreForm">Adresse de l'&eacute;cole</td>
            <td><textarea name="adresse"> {$smarty.get.adresse}</textarea></td>
        </tr>
        <tr>
            <td class="titreForm">Code Postal de l'&eacute;cole</td>
            <td><input type="text" name="cp" value="{$smarty.get.cp}"></td>
        </tr>
        <tr>
            <td class="titreForm">Ville de l'&eacute;cole</td>
            <td><input type="text" name="ville" value="{$smarty.get.ville}"></td>
        </tr>
        <tr>
            <td class="titreForm">Cycles</td>
            <td>
                    Cycle 1<input type="checkbox" name="cycles[]" value="cycle1" {if ($smarty.get.cycles[0]=="cycle1")} checked="checked" {/if}>
                    Cycle 2<input type="checkbox" name="cycles[]" value="cycle2" {if ($smarty.get.cycles[1]=="cycle2")} checked="checked" {/if}>
                    Cycle 3<input type="checkbox" name="cycles[]" value="cycle3" {if ($smarty.get.cycles[2]=="cycle3")} checked="checked" {/if}>
            </td>
        </tr>
        <tr>
            <td class="titreForm">Nom du chef d'&eacute;tablissement</td>
            <td><input type="text" name="chefEtablissement" value="{$smarty.get.chefEtablissement}"></td>
        </tr>
        <tr>
            <td class="titreForm">Nombre d'&eacute;l&egrave;ves</td>
            <td><input type="text" name="nbEleve" value="{$smarty.get.nbEleve}"></td>
        </tr>
        <tr>
            <td class="titreForm">T&eacute;l&eacute;phone</td>
            <td><input type="text" name="tel" value="{$smarty.get.tel}"></td>
        </tr>
        <tr>
            <td class="titreForm">Fax</td>
            <td><input type="text" name="fax" value="{$smarty.get.fax}"></td>
        </tr>
        <tr>
            <td class="titreForm">Mail</td>
            <td><input type="text" name="mail" value="{$smarty.get.mail}"></td>
        </tr>              
    </table>

    <center>
        <table>
            <tr>
                <td>
        {if ($smarty.get.action=="" or $smarty.get.action=="details")}
            <a href="index.php5?page=reserver_semaine&action=modifier">Modifier les informations</a>&nbsp;
        {/if}
        {if ($smarty.get.action=="modifier")}
            <a href="index.php5?page=florient">Annuler</a>&nbsp;
        {/if}  
                </td>
                <td>
                    <input type="submit" value="Modifier">
                </td>
            </tr>
         </table>
    </center> 
</form>
    {if $smarty.get.valid==true}
        <div id="erreurs">
            {$erreurs}
        </div>
    {/if}
{else}

    {if ($erreur=="" and $smarty.get.valid!=true)}
    {* MODIFICATION DES DONNEES POUR UNE ECOLE *}

    <form action="index.php5" method='get'>
        <input type='hidden' name='page' value='florient'>
        <input type='hidden' name='action' value='modifier_ecole'>
        <input type='hidden' name='valid' value=true>
        <input type='hidden' name='id' value="{$smarty.get.id}">
        <table align=center>
        <tr>
            <td class="titreForm">Nom de l'&eacute;cole</td>
            <td><input type="text" name="nom" value="{$ecole->get_nom()}"></td>
        </tr>
        <tr>
            <td class="titreForm">Ecole priv&eacute;e/Publique</td>
            <td>
                    Priv&eacute;e:&nbsp;<input type="radio" name="privPub" value="priv" {if (!$ecole->est_publique())}checked="checked" {/if}>
                    Publique:&nbsp;<input type="radio" name="privPub" value="pub" {if ($ecole->est_publique())}checked="checked"{/if}>
            </td>
        </tr>
        <tr>
            <td class="titreForm">Adresse de l'&eacute;cole</td>
            <td><textarea name="adresse">{$ecole->get_adresse()}</textarea></td>
        </tr>
        <tr>
            <td class="titreForm">Code Postal de l'&eacute;cole</td>
            <td><input type="text" name="cp" value="{$ecole->get_cp()}"></td>
        </tr>
        <tr>
            <td class="titreForm">Ville de l'&eacute;cole</td>
            <td><input type="text" name="ville" value="{$ecole->get_ville()}"></td>
        </tr>
        <tr>
            <td class="titreForm">Cycles</td>
            <td>
                        Cycle 1<input type="checkbox" name="cycles[]" value="cycle1" {if ($cycles[1]==true)} checked="checked" {/if}>
                        Cycle 2<input type="checkbox" name="cycles[]" value="cycle2" {if ($cycles[2]==true)} checked="checked" {/if}>
                        Cycle 3<input type="checkbox" name="cycles[]" value="cycle3" {if ($cycles[3]==true)} checked="checked" {/if}>
            </td>
        </tr>
        <tr>
            <td class="titreForm">Nom du chef d'&eacute;tablissement</td>
            <td><input type="text" name="chefEtablissement" value="{$ecole->get_nom_directeur()}"></td>
        </tr>
        <tr>
            <td class="titreForm">Nombre d'&eacute;l&egrave;ves</td>
            <td><input type="text" name="nbEleve" value="{$ecole->get_nb_eleve()}"></td>
        </tr>
        <tr>
            <td class="titreForm">T&eacute;l&eacute;phone</td>
            <td><input type="text" name="tel" value="{$ecole->get_tel()}"></td>
        </tr>
        <tr>
            <td class="titreForm">Fax</td>
            <td><input type="text" name="fax" value="{$ecole->get_fax()}"></td>
        </tr>
        <tr>
            <td class="titreForm">Mail</td>
            <td><input type="text" name="mail" value="{$ecole->get_mail()}"></td>
        </tr>              
    </table>
     
    <table align=center>
        <tr>
            <td><a href="index.php5?page=florient&action=accueil&action=gerer_ecoles">Annuler</a></td>
            <td><input type="submit" value="modifier"></td>
        </tr>
    </table>
    </form> 

    {else}
        <h1>Modifications effectu&eacute;es</h1>
        <a href="index.php5?page=florient&action=accueil&action=gerer_ecoles">Retour &agrave la gestion des &eacute;coles</a>
        <center><a href="index.php5?page=florient">Retourner &agrave; l'espace d'administration</a></center>
    {/if}
{/if}